
import './index.scss'
export const GoodsItem = ({goodsList,change_state}) => {
  console.log(goodsList);

  return(
    goodsList.map( item => (
      <div className="cart-goods-item" key={item.id}>
        <div className="left">
          <div className="custom-control custom-checkbox">
            <input type="checkbox" checked={item.goods_state} onChange={(e)=>change_state(e.target.checked,item.id)} className="custom-control-input" id={item.id} />
            <label className="custom-control-label" htmlFor={item.id}>
              <img alt="" src={item.goods_img}/>
            </label> 
          </div>
        </div>
        <div className="right">
          <div className="top">{item.goods_name}</div>
          <div className="bottom">
            <span className="price">¥ {item.goods_price}</span>
            <span>counter组件</span>
          </div>
        </div>
      </div>
    ))
  )


  
}